package chat.whiteboard.components.legend;

import javax.swing.DefaultListModel;
import javax.swing.JList;

import chat.whiteboard.WhiteBoardController;
import chat.whiteboard.models.UserModel;

public class LegendList extends JList<UserModel>{
	WhiteBoardController controller;
	public LegendList(WhiteBoardController controller){
		super();
		setCellRenderer(new LegendListCellRenderer());
		this.controller = controller;
		controller.registerLegenList(this);
		this.setModel(new DefaultListModel<UserModel>());
	}
	public LegendList(UserModel[] list, WhiteBoardController controller){
		super(list);
		setCellRenderer(new LegendListCellRenderer());
		this.controller = controller;
		controller.registerLegenList(this);
		this.setModel(new DefaultListModel<UserModel>());
	}
}
